/**
 * 传入一个file对象
 * return Promise
 */
 export const resolveToBase64 = (file) => {
    return new Promise((resolve) => {
      const fr = new FileReader()
      fr.readAsDataURL(file)
      fr.onload = (e) => {
        resolve(e.target.result)
      }
    })
  }